/*
 * Copyright (C) 2012 Matt Broadstone
 * Contact: http://code.google.com/p/qconnman/
 *
 * This file is part of the QConnman Library.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 */

#ifndef AGENT_H
#define AGENT_H

#include <QObject>
#include <QDBusObjectPath>
#include <QVariantMap>
#include <QStringList>

class Manager;
class Service;
class AgentAdaptor;
class QRegExpValidator;
class Agent: public QObject
{
    Q_OBJECT
    Q_PROPERTY(QDBusObjectPath path READ path)

public:
    explicit Agent(const QString &path, Manager *parent);
    explicit Agent(const QDBusObjectPath &path, Manager *parent);
    virtual ~Agent();

public:
    QDBusObjectPath path() const;
    Manager *manager() const;

Q_SIGNALS:
    void dataChanged();

public Q_SLOTS:
    virtual void Cancel();
    virtual void Release();
    virtual void ReportError(const QDBusObjectPath &service, const QString &error);
    virtual void RequestBrowser(const QDBusObjectPath &service, const QString &url);
    virtual QVariantMap RequestInput(const QDBusObjectPath &service, const QVariantMap &fields);

private:
    void setupValidators();

    Manager *m_manager;
    AgentAdaptor *m_adaptor;
    QDBusObjectPath m_path;


    QRegExpValidator *m_wepValidator;

};

#endif
